import java.util.Random;

public class 抽奖_important {
    public static void main(String[] args) {
        Random r = new Random();
        int[] arr = {2,88,555,888,1088};
        //这个数组用来记录被抽到的prize，用于后面判断是否被抽过；
        int[] newarr = new int[arr.length];
        for(int i = 0; i < arr.length;) {
            int index = r.nextInt(5);
            int prize = arr[index];
            if(isPrize(newarr, prize)) {
                newarr[i] = prize;
                i++;
            }
        }
        for (int i = 0; i < newarr.length; i++) {
            System.out.println("第" + (i + 1) + "个中奖号码是：" + newarr[i]);
        }
    }
    public static boolean isPrize(int[] arr, int prize){
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] == prize) {
                return false;
            }
        }
        return true;
    }
}
